<?php
require_once 'database.php';
require_once 'common.php';

session_start();

//Get information from the post
//Get information from the post
$strStoryName = $_POST['story_name'];
$strStoryDesc = $_POST['story_desc'];
$intStoryId= intval($_POST['story_id']);
//Update the story

$dbResult = mysql_query("UPDATE story SET story_name='$strStoryName' WHERE story_id='$intStoryId'")
 or die("Problem reading table: " . mysql_error());
$dbResult2 = mysql_query("UPDATE story SET story_desc='$strStoryDesc' WHERE story_id='$intStoryId'");

$objReturn = array();

$objReturn['code'] = "SUCCESS";
$objReturn['story_id'] = $intStoryId;

header("content-type:application/json");
echo json_encode($objReturn);

?>